﻿using aier.business.logic;
using aier.dataaccess.model;
using log4net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace aier.wx.api.selfhost.Controllers
{
    //[Authorize]
    [RoutePrefix("api/ScreenTemplate")]
    public class ScreenTemplateController : ApiController
    {
        public ScreenTemplateBll screenTemplateBll { get; set; }

        public ILog log { get; set; }
        
        public IHttpActionResult Get() {
            try
            {
                var templates = screenTemplateBll.GetScreenTemplates();
                return Ok(templates);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message, ex);
                return new ApiErrorResult(ex.Message, Request);

            }
        }

    }
}
